package diaosidadui.oop02;

public class Teacher {
    /*
  请定义教师类（Teacher），属性包括姓名和工号。。定义教课（teach）方法，输出“工号为xxx的xxx老师正在讲课”。
     */
    private String name;
    private String url;
    public Teacher() {

    }

    public Teacher(String name, String url) {
        this.name = name;
        this.url = url;
    }

    public void setName(String name){
        this.name=name;
    }

    public void setUrl(String url){
        this.url = url;
    }
    public String getName(){
        return name;
    }
    public String getUrl(){
        return url;
    }

/*    public String toString(){
        return "name"+name+"age"+age;
    }*/

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", url=" + url +
                '}';
    }

    public void teach(String name){
        System.out.println("给"+name+"讲课");
    }
}
